UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TdxNVIfhndP3Jm0kcqvke1vTVu0b9UbxGA+pvdmaH7o=' 
WHERE 
  key_id = 'b4b585e7b9b1c6fb8287e1f35130e76ebd1a26a7aae06aa5c4601781cf104053' 
  AND (
    token = 'TdxNVIfhndP3Jm0kcqvke1vTVu0b9UbxGA+pvdmaH7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025