UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vy0ey54U4MbALuJpO2AHKqMvjW1Og+SAWjgjw6fJ0/U='
WHERE
key_id = '045eb08a6c756a81d90ecebc477cf7ebe2b12ae33562dcbf40a89e4fce08f99b'
AND (
token = 'vy0ey54U4MbALuJpO2AHKqMvjW1Og+SAWjgjw6fJ0/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)