UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ltd2ox3RvToTqc7dxJwL/eUcZ+14rkHJ/c0Mm3STLPc='
WHERE
key_id = 'ba6e91cd346557a22fa1c15de288ede4f29588489e23e53165dc55b1aae952ce'
AND (
token = 'Ltd2ox3RvToTqc7dxJwL/eUcZ+14rkHJ/c0Mm3STLPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)