UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TEXUciLIclH0IfQheH2Rdwq1NdE4ERoRu+FHI0f62sc='
WHERE
key_id = '4ec7f7caef032f627fbe729c0cf757e58dea5147017102809a54c2c82878cac1'
AND (
token = 'TEXUciLIclH0IfQheH2Rdwq1NdE4ERoRu+FHI0f62sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)