UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CFaKNQXfEjh/35W1/3+Bf71OSFchYb/EuLVmkNX0HhQ='
WHERE
key_id = '813b8cc0c697b86137fff17b6cc276a7593a8283f22bd39cd8862a067c2f94fd'
AND (
token = 'CFaKNQXfEjh/35W1/3+Bf71OSFchYb/EuLVmkNX0HhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)