UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6pxWeKoWAz7gtYA//O7eXLj+z8CNwVE2YEKQYzFjV9g='
WHERE
key_id = '0e78f6ce7630f270fe25f0ddbcfe79b19d314661d9583890502c543e6e01431c'
AND (
token = '6pxWeKoWAz7gtYA//O7eXLj+z8CNwVE2YEKQYzFjV9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)