UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WiCNDbqXYjCGwBCTLQq44wT97AKN5r3rtp2eqigsiS4='
WHERE
key_id = '19075863afc851f080ca90ca256c239292c60c7bb55358127e7d7985cdbb6c61'
AND (
token = 'WiCNDbqXYjCGwBCTLQq44wT97AKN5r3rtp2eqigsiS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)