UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VtuMNpUVgVTDIoXEZSFzhm7A+4lDNnaHtHbX78DegZE='
WHERE
key_id = 'd5e4dabf07781f5ead202984aaab02ae6d23b0c1972993aa2f3357ab4adcf86a'
AND (
token = 'VtuMNpUVgVTDIoXEZSFzhm7A+4lDNnaHtHbX78DegZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)