UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sTjsrcUuatESuZLNDdop2vC4NDN7RzSbVIHz84EXJVw=' 
WHERE 
  key_id = 'd6a5b933ba1b9d766e70eff206bdd3c156e78d8cd303d4d71a98985b548dcd43' 
  AND (
    token = 'sTjsrcUuatESuZLNDdop2vC4NDN7RzSbVIHz84EXJVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049