UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JYQhJBjLxI03eXt22t1krRuDwmcp8wnsMNsvnDkzQAs='
WHERE
key_id = '6ab1daaeb321825ff2e13872a57e7d7cf971b34ea6ee3395eb6dc87caddca03f'
AND (
token = 'JYQhJBjLxI03eXt22t1krRuDwmcp8wnsMNsvnDkzQAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)