UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wNcpJTL93+pWuUZTk8+vSNPAjMFjZt4i7ABc+4anbs0='
WHERE
key_id = '48e578de30c8b60ad4d1f3fa4be843b43114cdaba79905521dd376262f9eaead'
AND (
token = 'wNcpJTL93+pWuUZTk8+vSNPAjMFjZt4i7ABc+4anbs0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)