UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's9ZbEOhxzYuZtsRj4H6FFKfL1slVeGddVUkrlpZndjM='
WHERE
key_id = 'db7ab50613b547fb225d9fb882f77a13aabcc43e0727f7bb3d1718a9fd769ca0'
AND (
token = 's9ZbEOhxzYuZtsRj4H6FFKfL1slVeGddVUkrlpZndjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)