UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '74Fn6Um6P2Fw6UYVsIjTd4BSCT7Ch2nDDZZ+s2VL3Mc='
WHERE
key_id = '5f9f54284fb32d57870ec0886fe7b36cf274e35840d930cffc1c16461343587d'
AND (
token = '74Fn6Um6P2Fw6UYVsIjTd4BSCT7Ch2nDDZZ+s2VL3Mc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)