UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YyRNcy775sqF2AXknFcnS7ERG0ug+Uiw1TV4xKFH/Do='
WHERE
key_id = '4d52a4d1bd6a8cccdf906e093823626e1f63afb35758ace370ec00bfe62e2698'
AND (
token = 'YyRNcy775sqF2AXknFcnS7ERG0ug+Uiw1TV4xKFH/Do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)