UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4YTi2duQrRu1pPffWpm/Lndt6osLW05D5hTU9kzWDmA='
WHERE
key_id = 'a2083786aeba0b56d0a592c17a826f9d4e7b303afd27deb6fe4d46419f79ff4b'
AND (
token = '4YTi2duQrRu1pPffWpm/Lndt6osLW05D5hTU9kzWDmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)