UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rLbpZuh/y7MQkepYrkifC+phlKM3vB4k4UlVNsEdiMA=' 
WHERE 
  key_id = 'e4976a13c838d2998f244c6dad17a5e31bd64a70847368768632a67a078c781d' 
  AND (
    token = 'rLbpZuh/y7MQkepYrkifC+phlKM3vB4k4UlVNsEdiMA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047