UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JPm1E05reVMRpdTHmopwqKJ8dmawZPeJT6/jLzG4iIM=' 
WHERE 
  key_id = '3cfe6f5b0788f9f18d37b742ad9de86c1feab24e214100959516b69a3bb40bf1' 
  AND (
    token = 'JPm1E05reVMRpdTHmopwqKJ8dmawZPeJT6/jLzG4iIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023