UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0uW1ETs8SbHS+iFlmNAxoIlf728Xz8bpl3LHYdu8Crs='
WHERE
key_id = '5cc9a8100a1f6d21a109bfa70f86fe26b3405679dfb863eaabcc9feacac8c9f2'
AND (
token = '0uW1ETs8SbHS+iFlmNAxoIlf728Xz8bpl3LHYdu8Crs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)