UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YpYqA5thc9dOFlQgtoC7bDQkVpdsTxDfd5Z1Rat4tTc='
WHERE
key_id = '44138180652059073e1012f64f6449a18852de759faf5966af1818aaf96bfaa1'
AND (
token = 'YpYqA5thc9dOFlQgtoC7bDQkVpdsTxDfd5Z1Rat4tTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)