UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SC3MLabn4TDlc2aNqt/m0qeUFjqMBjuP7dxW5x16hAA=' 
WHERE 
  key_id = '5bb90cb853e9c45e1b0f2137b5749fb95d3a56dc1118c58b3cf8c6effb67a4e8' 
  AND (
    token = 'SC3MLabn4TDlc2aNqt/m0qeUFjqMBjuP7dxW5x16hAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026