UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0KPm0HrkvQo12wUG9GDzMjqVFiVCwDuyg7d1EdBfuSo=' 
WHERE 
  key_id = 'c3f05f7d15e543bbc2c1411c66b4cc9f16362e3b6a5dd8d05b81c3066e4af622' 
  AND (
    token = '0KPm0HrkvQo12wUG9GDzMjqVFiVCwDuyg7d1EdBfuSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030