UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yBliGkvnKGlB2sD6S77S5Ldb6q9VxT0Mp8NPIRPjMrQ='
WHERE
key_id = '2bd3ea6c709e08de1853f627605b32ab4bffc8913f21f5e17388cc7f518e0700'
AND (
token = 'yBliGkvnKGlB2sD6S77S5Ldb6q9VxT0Mp8NPIRPjMrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)