UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q+RMmCqZdLzgCYY6zBr3is/TLTSkqaWKd2EdUoP8cUc=' 
WHERE 
  key_id = 'fea6be813798e278aa52c8ce339098f7a82bc3a7124633110a545f7842b8dda6' 
  AND (
    token = 'Q+RMmCqZdLzgCYY6zBr3is/TLTSkqaWKd2EdUoP8cUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034