UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yLcRTrqA2aGDytzEt5dJ5oRpwwLi3gmEBLlzXnjPAHA='
WHERE
key_id = '0b487fbbe1101824d39db9ea1b506f0018177a0f65b97347b3f9447e21e1726a'
AND (
token = 'yLcRTrqA2aGDytzEt5dJ5oRpwwLi3gmEBLlzXnjPAHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)