UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7x1QVRSttkcji5x7q0c7y1qcDSGvYvNFeTi79B26/Q0='
WHERE
key_id = '81a0345436f807fe044dbc1df9145faa46b37b5b7cd793cb18aa912e4b081e41'
AND (
token = '7x1QVRSttkcji5x7q0c7y1qcDSGvYvNFeTi79B26/Q0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)