UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VaXmwQT0hRR3SMq6bwKJrm1Zu1HIU2sYi6zv6YHQR6s='
WHERE
key_id = '9b7376f8e75a9d972fb874de7bc703fb65905c2837f0540771e694b6f946f9b9'
AND (
token = 'VaXmwQT0hRR3SMq6bwKJrm1Zu1HIU2sYi6zv6YHQR6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)