UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ic9H0m7Cws5py2kp0zi9vxaMJ/vxLYz9imYZUTxp7E=' 
WHERE 
  key_id = '583cd9f79c1fa4255fe3b9dbaa13e5be20809b1136216d97b3a46dc6f272dceb' 
  AND (
    token = '/ic9H0m7Cws5py2kp0zi9vxaMJ/vxLYz9imYZUTxp7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037