UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/g2TMN/yNv4c7qzNMnvS/7oyB2GRce3c1UdIRH0/FTo='
WHERE
key_id = 'e08b4b2382120523d6845a91c6503b6803bf710b166511241921b2a6c520935f'
AND (
token = '/g2TMN/yNv4c7qzNMnvS/7oyB2GRce3c1UdIRH0/FTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)