UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JbmvtrXYAtqQP7hWxE1kA9fNodIe9BfexzPfUVq/zA0=' 
WHERE 
  key_id = '9e2b35b61bc6703a7b2e955bf63eb81cb3da0a455511204c3f8710f2a90360c8' 
  AND (
    token = 'JbmvtrXYAtqQP7hWxE1kA9fNodIe9BfexzPfUVq/zA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00089