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