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