UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'psOKTtyjuDfTMNo1XRixXKYm8UhvdDO3e6c4XpN/gZ8='
WHERE
key_id = '5c651cbfd73823eeeb1cef848700dbba2b15a6fe5e7ef857b15381815e61f45c'
AND (
token = 'psOKTtyjuDfTMNo1XRixXKYm8UhvdDO3e6c4XpN/gZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)