UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wF9Ct4JKm/411LNJbgJgWHUCTDvZqzzlCSWg8I4BlaQ='
WHERE
key_id = '5018c94adf6dd2ee33e9d77f76a75b46eef8c652d3acd724289b15912fb1d732'
AND (
token = 'wF9Ct4JKm/411LNJbgJgWHUCTDvZqzzlCSWg8I4BlaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)