UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xL0rqoFwLDPCvDUCHEgwQ8WOcqezGyNUYNvFDJzzAAY='
WHERE
key_id = '945277f0c365b8af057c4db742d32629839f265a437158fea2911e7b278c5834'
AND (
token = 'xL0rqoFwLDPCvDUCHEgwQ8WOcqezGyNUYNvFDJzzAAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)