UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b4jDpdeJdlsRTmdq/uCYm641oxPZvj77nHhGjVpOYLw='
WHERE
key_id = 'a10f6cdfe090b1cf1bb4226647ba652360654f3edbf70f8f06d561e5eb24a879'
AND (
token = 'b4jDpdeJdlsRTmdq/uCYm641oxPZvj77nHhGjVpOYLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)