UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Z4e3LS9dr3gRrKLZWg7BzgXzGW+vl9NRMyHtBukJOQ='
WHERE
key_id = '1e0404cadc4eb3ac2fe5c4dc651a5305ee5776853af17116ccc4fd05a0a6955c'
AND (
token = '5Z4e3LS9dr3gRrKLZWg7BzgXzGW+vl9NRMyHtBukJOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)