UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxpV3rVa3heLrkJr6eMgKzQp6ceERCU29319zu4qXUE='
WHERE
key_id = '7ee4e92e4a94d64c45085fb591fbbf31de60f33d84ae6589bb061e6d51f21fe3'
AND (
token = 'GxpV3rVa3heLrkJr6eMgKzQp6ceERCU29319zu4qXUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)