UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K+wH15zl0XaiTatZxt8tpsAbIxzcc57esuoPYjvaqPQ='
WHERE
key_id = '8e82ee180a7170ca2e70c523781de51edf94e0e1a00c286248be1373137d3627'
AND (
token = 'K+wH15zl0XaiTatZxt8tpsAbIxzcc57esuoPYjvaqPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)