UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8qXyFpkVPUX2lUrrtf/2WJVhH8u2zcmxZx+6FObyYfI='
WHERE
key_id = '09c7852edac31d8c85283b7d921b9845709fe484d2c530a495d741226999a93f'
AND (
token = '8qXyFpkVPUX2lUrrtf/2WJVhH8u2zcmxZx+6FObyYfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)