UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xHwDUxbYk5D6q91T33h/XO5st5xR0BCGnoXUxdaz+HQ='
WHERE
key_id = 'bf9f1381c850fc2d1f790c06b063ae9c13ff6c3cb5c77b0b8d50d7964510de21'
AND (
token = 'xHwDUxbYk5D6q91T33h/XO5st5xR0BCGnoXUxdaz+HQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)