UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vHOZHKqd7QkjMKPNgE07QSfGocAsaimrhs+nmM4mqy8=' 
WHERE 
  key_id = '6dbd58e499335956b4302c88d93b1cea13bb19fb55134a22e7703bcd7398906f' 
  AND (
    token = 'vHOZHKqd7QkjMKPNgE07QSfGocAsaimrhs+nmM4mqy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030