UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zN4k3nUVgfKob5kMF/zavMcxvf5KqxegW1M9UYqYPPY='
WHERE
key_id = '424c6217121b14d03c478c501093c5603fb7d7850ba273665c0968d7864d963c'
AND (
token = 'zN4k3nUVgfKob5kMF/zavMcxvf5KqxegW1M9UYqYPPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)