UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '94vXB1Wni61dh9b4biEEEr/x/kRex60PP1x5THCl+Zg='
WHERE
key_id = '58eadaedca91c205002cb072a25e8c333b97e0107f8e24c0b5ecb0e58681197c'
AND (
token = '94vXB1Wni61dh9b4biEEEr/x/kRex60PP1x5THCl+Zg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)