UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EOY9PdO+5dANBm87hTayLEuUjO1kKMJsPxcN0eK6TWg='
WHERE
key_id = '560e85e15f88603ffb5311def3d6c377de14bbf80150cba1ea48fe4926c25d0c'
AND (
token = 'EOY9PdO+5dANBm87hTayLEuUjO1kKMJsPxcN0eK6TWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)