UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O3rRDxVZihDviQmlbBdhLY7CvPCtLN5MK8LHHrPcShI=' 
WHERE 
  key_id = '9a96e2f3fa4cce9a483d94a8fa113b470730c9b8a5985fe86668b448be4b6b0b' 
  AND (
    token = 'O3rRDxVZihDviQmlbBdhLY7CvPCtLN5MK8LHHrPcShI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044