UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KHkKrjcsWzxwQVD3T1tSZAT7brDFYQiFZHr3nwnhMKM='
WHERE
key_id = '14726b2c49021dedbc8aeb3badb9b3888415030bce0a0b5249ebd562eec49aa9'
AND (
token = 'KHkKrjcsWzxwQVD3T1tSZAT7brDFYQiFZHr3nwnhMKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)