UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CXC84ojm8og0tk8A6hpx5s9hmZsaiMEyZ5GL2sxatpU=' 
WHERE 
  key_id = '6a69677b31e5fd35c4e36db5bb29012d4c7fb7f1b66172e5242e33291aa6dcbe' 
  AND (
    token = 'CXC84ojm8og0tk8A6hpx5s9hmZsaiMEyZ5GL2sxatpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027