UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nr2v3sX6+afXgdIJzV4U7m4KkbSc8l1OjlgcHCy1lyg='
WHERE
key_id = '0082fb0b99005b1bdcb697ecb1bf3af0c4ddf446a7973d7716ab5d05138bf773'
AND (
token = 'Nr2v3sX6+afXgdIJzV4U7m4KkbSc8l1OjlgcHCy1lyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)