UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DXa8a4gZ+uMGg1Wq4K6iFIxF5anJOvm7SljZcLub43M='
WHERE
key_id = '2711ba15c120c4b5e0eceec7eb375d5e7b64ae57dcf388f3874755ac744ed3eb'
AND (
token = 'DXa8a4gZ+uMGg1Wq4K6iFIxF5anJOvm7SljZcLub43M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)