UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VpgJfUTRStrnG+q88NxBPcg2pEGW93FBpzB08PIsT0='
WHERE
key_id = 'b7dbd8e53c0474c529e263c9bfa9f504964ba84158600f7a60efeca93cd95caf'
AND (
token = '5VpgJfUTRStrnG+q88NxBPcg2pEGW93FBpzB08PIsT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)